<%-- 
    Document   : order_history
    Created on : 21.04.2013, 15:21:26
    Author     : Yasya,Svetlana Shikhutskaya
--%>

<%@page import="java.text.SimpleDateFormat"%>
<%@page import="entity.Orders"%>
<%@page import="delta.cart.bean.CartLocal"%>
<%@page import="entity.Users"%>
<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="order_history.jsp"%>
<!DOCTYPE html>
<%
    CartLocal cart = (CartLocal) session.getAttribute("cart");
    Orders order = (Orders) session.getAttribute("order");
    String date = new SimpleDateFormat("dd-MM-yyyy").format(order.getOrderDate());
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/order_history.css">
                   <link rel="stylesheet" type="text/css" href="css/all.css">

        <title>our_product</title>
    </head>
    <body>
        <header>
            <div id ="top_name"> <a href="main.jsp"> <img src="/Delta-war/product/1.jpeg"></a>  
            <h1>Unregistered user</h1> </div>
           
            <div id ="shopping" style="position: relative; bottom: 160px;">    
                <a href="cart_user.jsp">Cart</a>                     
                <input type="text" name="Count_product" size="1" readonly value="<%=cart.getCount()%>" /> products
            </div>
            <div id="price_shopping"style="position: relative; bottom: 185px;"> <input type="text" name="Prcie" size="8" readonly value="<%=cart.getTotalPrice()%>" /> $  
            </div>

            
        </header>
        <div id="main" style="height: 470px;">
            <div id="tabl1" style="position: relative; top: 80px;">
                <table class="table-orders">
                    <TR>
                        <td id="head"><strong>Order number</strong></td>
                        <td id="head" style="width: 100px;"><strong>Date</strong></td>
                        <td id="head"><strong>Delivery date</strong></td>
                        <td id="head"><strong>Sum</strong></td>
                        <td id="head"><strong>Status</strong></td>
                        <td id="head" style="width: 100px;"><strong>Address</strong></td>
                    </TR>
                    <TR>
                        <td id="body"><span><%=order.getTrackingNumber()%></span></td>
                        <td id="body" style="width: 100px;"><span><%=date%></span></td>
                        <%if (order.getOrderStatus().equals("delivered")) {
                                String duedate = new SimpleDateFormat("dd-MM-yyyy").format(order.getDeliveryDate());
                        %>
                        <td id="body"><span><%=duedate%></span></td> 
                        <%} else {%>
                        <td id="body"><span>None</span></td> 
                        <%}%>
                        <td id="body"><span><%=order.getProductPrice()%></span></td>
                        <td id="body"><span><%=order.getOrderStatus()%></span></td>
                        <td id="body" style="width: 100px;"><span><%=order.getAddress() %></span></td>
                    </TR>
                </table>

            </div>
        </div>
                    <div id="footer">
                                <p>  &#169;All rights reserved</p>
                            </div>
    </body>
</html>
